<?php
/**
 * 验证
 */

namespace Common\Controller\Api;

use Common\Model\MemberModel;


class MobileCommonController extends CommonController
{
    public function __construct()
    {
        parent::__construct();
        $this->isMobile();
    }
    /**
     * 检查是否有店铺id
     */
    public function isMobile()
    {
        $member_id = session('member_id');
        if(!is_numeric($member_id)){
            $this->ajaxReturn(['code'=>305,'msg'=>'您好，你还未绑定手机号请先绑定手机号']);
        }else{
            $model  = new MemberModel();
            $mobile = $model->where("userid='$member_id'")->getField('mobile');
            if(empty($mobile)){
                $this->ajaxReturn(['code'=>305,'msg'=>'您好，你还未绑定手机号请先绑定手机号']);
            }
        }
        $this->checkLogin();
    }
}